Linux time zone details and common time functions time and time zone The entire earth is divided into 24 time zones, each time zone has its own local time. ø UTC Time and GMT time We can think of Greenwich Mean Time (GMT = UTC), GMT and
Nowadays, more and more work needs to use the time zone concepts around the world. Recently, I have seen abbreviations such as DST, EDT, PDT, wet, and CCT in my documents, which makes me dizzy. So I made a memo on the Internet:
The time zone
Time zone abbreviation UTC, CST, GMT, CEST and conversionUTC is an abbreviation for Coordinated Universal Time (Universal time coordinated), which is defined and recommended by the International Radio Advisory Committee and is maintained by the
Tzselect
Execute tzselect Command--Select asia--> Select china--> Select East China-beijing, Guangdong, Shanghai, etc--> and enter 1
Select (5) Asia time zone
Please identify a, so, time zone rules can be set correctly.
Please select a continent
1. Check the system time[[Email protected] ~]# DateThu Dec 23:25:33 CST 2012[[Email protected] ~]# date + "%y%m%d%h:%m:%s"20121220 23:12:542. View hardware TimeThe system clock is the clock in the current Linux kernel, and the hardware clock is a
# Save settings$ Sudo mv/etc/localtime. old# Set the time zone $ Sudo ln-sf/usr/share/zoneinfo/Asia/Hong_Kong/etc/localtime# Changed # Update some files. This file is read by the system-config-date command. $ Sudo vim/etc/sysconfig/clock# You can
Linux/unix-time timestamp processing conversion functionThe time function under LinuxWe can often use time in programming, such as getting the system time (to get the system's year, month, day, hour, minute, second, week, etc.), or to do something
First, the Linux common time correlation function-asctime,ctime,getttimeofday,gmtime,localtime,mktime,settimeofday,timeAsctime: Converting dates to stringsCTime: Converts a number of seconds into a stringGettimeofday: Gets the time and date based on
The consistency of time is critical, and the analysis of logs and the docking of the program are essential!01. Tzselect Modify Time zoneYou can use the command Tzselect to modify the time zone. Examples of operations:
$ tzselect
Please
01. Time () provides second-level precision02.03.1 header file 04.2 function prototype05. time_t time (time_t * timer)06. The function returns the number of seconds from TC1970-1-1 0: 0 to the present07.08. Use the time () function combined with
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.